package com.ts.mark.controller;

import com.ts.mark.entity.Movie;
import com.ts.mark.service.MarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ts.common.entity.ResponseResult;

import java.util.List;

@RestController
@RequestMapping("/mark")
public class MarkController {

    @Autowired
    private MarkService markService;

    @GetMapping("/action/query")
    public ResponseResult query(@RequestHeader("userInfo") String userInfo) {
        List<Movie> list = markService.mark(userInfo);
        return ResponseResult.success(list);
    }
    @PostMapping("/{id}")
    public ResponseResult add(@PathVariable Integer id, @RequestHeader("userInfo") String userInfo){
        markService.add(id,userInfo);
        return ResponseResult.success();
    }
}
